<?php

require("enroll_config.php");

$Query = "SELECT 
id,
code,
first_name,
last_name,
position,
company,
c_address,
p_address,
email,
o_phone,
m_phone,
h_phone,
aid,
date,
status, city,
state,
zip,country,
pstate,pzip,	pcity,
	pcountry 
FROM $table WHERE id=$id LIMIT 1";

$r=myQuery($Query);

$code=$r[0][1];
$first_name=$r[0][2];
$last_name=$r[0][3];
$position=$r[0][4];
$company=$r[0][5];
$c_address=$r[0][6];
$p_address=$r[0][7];
$email=$r[0][8];
$o_phone=$r[0][9];
$m_phone=$r[0][10];
$h_phone=$r[0][11];
$aid=$r[0][12];
$date=$r[0][13];
$status=$r[0][14];
$City= $r[0][15];
$State= $r[0][16];
$Zip= $r[0][17];
$Country= $r[0][18];
$Pstate= $r[0][19];
$Pzip= $r[0][20];
	$Pcity=$r[0][21];
	$Pcountry=$r[0][22];
$Query = "select date, time, presented, venue, name, country  from med_aevening where id='$aid'";
$r = myQuery($Query);
$adate = $r[0][0];
$atime = $r[0][1];
$presented = $r[0][2];
$venue = $r[0][3];
$name = $r[0][4];
$sprog = $r[0][5];
$from_name = "Acuity World";
$from_email = "info@acuityworld.com";
$to_name = $first_name;
$to_email = $email;

$subject = "Acuity Evening - pladsreservation";

/*
$file = "aenroll_rec.php?";

$target = 
"first_name=" . urlencode($first_name) . 
"&adate=" . $adate . 
"&atime=" . $atime . 
"&presented=" . urlencode($presented) . 
"&venue=" . urlencode($venue) . 
"&name=" . urlencode($name) . 
"&signdate=" . urlencode($signdate) . 
"&last_name=" . $last_name . 
"&position=" . $position . 
"&company=" . urlencode($company) . 
"&c_address=" . urlencode($c_address) . 
"&p_address=" . urlencode($p_address) . 
"&email=" . urlencode($email). 
"&o_phone=" . $o_phone . 
"&m_phone=" . urlencode($m_phone) . 
"&h_phone=" . urlencode($h_phone);

$content =  file($file . $target);

/*
$content1 = $remark . "<br><br>";


for ($i=0;$i<count($content);$i++){
	$content1 .= $content[$i];
}

*/

//for ($i=0;$i<count($content);$i++){print $content[$i];}
$content1 = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html>
<head>
<title>Acuity World</title>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
</head>
<body bgcolor='#FFFFFF'>
<table width='600' border='0' cellspacing='0' cellpadding='1'>
  <tr>
    <td align='right'><table width='180' border='0' cellpadding='1' cellspacing='0'>
  <tr>
    <td bgcolor='#000000'><table width='100%' border='0' cellpadding='1' cellspacing='0' bgcolor='#FFFFFF'>
        <tr>
                <td align='center'><font size='3' face='Verdana, Arial, Helvetica, sans-serif'><strong>Acuity World</strong></font></td>
        </tr>
      </table></td>
  </tr>
</table></td>
  </tr>
</table>
<p><font size='2' face='Arial, Helvetica, sans-serif'>K&aelig;re $first_name,</font></p>
<p>Det gl&aelig;der os at kunne meddele dig at vi nu har en plads  til dig p&aring; den Acuity Evening du har tilmedt dig.</p>
<p><font size='2' face='Arial, Helvetica, sans-serif'>Dato: 
  $adate <br>
Tid: 
  $atime <br>
Acuity Evening: 
  $presented <br>
Sted: 
  $venue <br>Sprog: $sprog<br>
Beskrivelse: 
  $name <br>
  <br>
Dine personlige oplysninger:<br>
Dato for tilmelding: 
  $date <br>
Fornavn: 
  $first_name <br>
Efternavn: 
  $last_name <br>
Stilling: 
  $position <br>
Firma: 
  $company <br>
  Firma-adresse </font> <font color='red' size='2' face='Arial, Helvetica, sans-serif'><br>
  </font><font size='2' face='Arial, Helvetica, sans-serif'> Vej / husnr.: $c_address <br>
Postnr.: </font> <font size='2' face='Arial, Helvetica, sans-serif'>$City</font><font color='red' size='2' face='Arial, Helvetica, sans-serif'><br>
</font><font size='2' face='Arial, Helvetica, sans-serif'> By: $State<font color='red'><br>
</font> Omr&aring;de: $Zip <br>
Land:  $Country<br>
Privat-adresse<font color='red'><br>
</font>Vej / husnr.: $p_address<br>
Postnr.: $Pstate<font color='red'><br>
</font> By:  $Pzip<br>
Omr&aring;de: $Pcity<font color='red'><br>
</font> Land: $Pcountry</font><font size='2' face='Arial, Helvetica, sans-serif'><br>
Email: 
  $email <br>
  Telefonnr., arbejde: 
  $o_phone <br>
  Mobilnr.: 
  $m_phone <br>
  Telefonnr., privat: 
  $h_phone </font><font size='2' face='Arial, Helvetica, sans-serif'><br>
</font></p>
<p>Udskriv venligst denne bekr&aelig;ftelse og medbring den til brug for registrering. Vi gl&aelig;der os til at se dig.</p>
<p><font size='2' face='Arial, Helvetica, sans-serif'>Med venlig hilsen,<br>
</font></p>
<p><font size='2' face='Arial, Helvetica, sans-serif'>Acuity World<br>
  Making Leadership Personal with PLP&#8482;<br>www.acuityworld.com<br>
  Tlf.:  +45 4448 6969</font></p>
<p>&nbsp; </p>
</body>
</html>
";
sendhtmlmail($from_name,$from_email,$to_name,$to_email,$subject,$content1);
/*
$headers = "From: Acuity World <info@acuityworld.com>\r\n";
$headers .= "X-Sender: <info@acuityworld.com>\r\n";
$headers .= "Return-Path: <info@acuityworld.com>\r\n";
$subject = "Acuity Evening C 'Waiting List' to 'Seat Confirmation'\r";

$message = "";

$message .= "Dear $first_name,\n\n";

$message .= "Thank you for the sign up of our Acuity Evening !\n\n";

$message .= "Please note that you are now having the seat of the following Acuity Evening.\n\n";

$message .= "Date: $adate\n";
$message .= "Time: $atime\n";
$message .= "Evening Topic: $presented\n";
$message .= "Venue: $venue\n";
$message .= "Program: $name\n\n";

$message .= "Your Personal Information:\n";
$message .= "Date of Sign Up: $date\n\n";

$message .= "First Name: $first_name\n";
$message .= "Last Name: $last_name\n";
$message .= "Position: $position\n";
$message .= "Company: $company\n";
$message .= "Company Address: $c_address\n";
$message .= "Private Address: $p_address\n";
$message .= "Email: $email\n";
$message .= "Office Telephone: no.: $o_phone\n";
$message .= "Mobile telephone no.: $m_phone\n";
$message .= "Home telephone no.: $h_phone\n\n\n";


$message .= "Please print and bring this confirmation with you for the registration.  We are looking forwards to see you.\n\n";

$message .= "Best regards,\n\n\n";


$message .= "Acuity World\n";
$message .= "Making Leadership Personal with PLP in Denmark & HK\n";
$message .= "www.acuityworld.com\n";
$message .= "Tel: +45 4448 6969\n";
mail($to, $subject, $message, $headers);
*/

header("location:" . $rela_path . "share/msg.php?v=75&aid=$aid");

exit();

?>